function [k,F] = buildspecfil(ts,D,M)
% buildspecfil(ts,D,M)
%
% 	Parameters:
% 		ts: 	time series
% 		D:	displacement
% 		M:	kernel size
% 
% 	Outputs:
% 		k	the kernel
% 		F	the desired filter
% 
% 	Purpose of this code:
% 	This code is designed to build a specific filter that can be used for interpolation and to return it.
    
w = getWindow('blackman3',M,D);

Dadj = D - (M-1)/2; % adjust delay for kernel length

Dint = round(Dadj); % integer portion of delay
%Dint = floor(Dadj); % integer portion of delay


k = (-(M-1)/2):1:((M-1)/2); % kernel index
s = (Dadj-Dint)-k; % filter argument
F = (sinc(s)).*w;